#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/8/30 11:53
# @Author : 闫峰
# @File    : sku_filter.py
import datetime

import requests

from common.setting import ensure_path_sep
from utils.mysqlUtils.db_pool import Database
import os
import threading
import time
from common.setting import ensure_path_sep
from utils.logging_tool.log_control import LogHandler
from utils.mysqlUtils.db_pool import Database

current_path = os.path.abspath(__file__)
current_dir = os.path.dirname(current_path)
path_list = current_path.split("\\")
dis_path = "\\".join(path_list[-2:-1])


def remove_file(info_path):
    if os.path.exists(info_path):
        os.remove(info_path)
    else:
        print(f"{info_path} 不存在")


info_path = ensure_path_sep(f"\\logs\\info-{dis_path}{time.time()}")
error_path = ensure_path_sep(f"\\logs\\\error-{dis_path}{time.time()}.log")
warning_path = ensure_path_sep(f"\\logs\\warning-{dis_path}{time.time()}.log")
remove_file(info_path)
remove_file(error_path)
remove_file(warning_path)
INFO = LogHandler(info_path, level='info')
ERROR = LogHandler(error_path, level='error')
WARNING = LogHandler(warning_path, level='warning')


class SkuFilter:
    db = Database(ensure_path_sep("\\config\\shopeev2_config.yaml.bak"), "test_jdw_database")

    # 初始数据源
    # t_walmart_freight_template
    # 查询到已经设置默认模板的渠道id
    # 查询刊登成功的数据
    # t_walmart_publish_strategy_execute_queue_detail
    # t_walmart_listing
    # t_walmart_execute_queue
    def sku_filter(self, source_id):
        get_template_id = """
        SELECT template_id FROM test_zhcxkj_center_listing_comprehensive.t_walmart_freight_template
        WHERE source_id=%s
        and default_temp=1
        and status=1
        and is_deleted=0
        """
        template_id = self.db.fetch_all(get_template_id, (source_id,))
        if not len(template_id):
            INFO.logger.info(f"渠道{source_id}没有绑定运费模板，不会筛选出数据")
            return
        template_id = template_id[0].get("template_id")
        # 通过渠道id 去t_walmart_publish_strategy_execute_queue_detail表筛选数据
        get_first_id = """
        SELECT id,sku,source_sku,update_time
        FROM test_zhcxkj_center_strategy_comprehensive.t_walmart_publish_strategy_execute_queue_detail
        WHERE source_id=%s
        AND business_status=2
        AND update_time >= DATE_SUB(NOW(),INTERVAL 30 DAY)
        AND update_time <= NOW() 
        ORDER BY id
        LIMIT 1
        """
        first_id = self.db.fetch_all_tuple(get_first_id, (source_id,))
        first_id = first_id[0][0] - 1
        res_list = []
        while True:
            get_data = """
            SELECT id,sku,source_id,source_sku
            FROM test_zhcxkj_center_strategy_comprehensive.t_walmart_publish_strategy_execute_queue_detail
            WHERE id>%s 
            and source_id=%s
            AND business_status=2
            AND update_time >= DATE_SUB(NOW(),INTERVAL 15 DAY)
            AND update_time <= NOW() 
            and is_deleted=0
            ORDER BY id
            LIMIT 1000
            """
            data = self.db.fetch_all_tuple(get_data, (first_id, source_id))
            if not len(data):
                break
            first_id = data[-1][0]
            # current_time = datetime.datetime.now()
            # previous_time = current_time - datetime.timedelta(days=7)
            # filter_data = list(filter(lambda x: previous_time <= x[3] <= current_time, data))

            filter_data = list(filter(self.filter_t_walmart_listing, data))
            if not filter_data:
                continue
            filter_data = list(filter(self.fllter_t_walmart_execute_queue, filter_data))
            if not filter_data:
                continue
            res_list += filter_data
        INFO.logger.info(f"符合的数据有{len(res_list)}个")
        res_list = set(map(lambda x:(x[1],x[2],x[3]),res_list))
        print(res_list)
        # res_list = {('10015994', 11623, 'DWX193134RRJQ12JS'), ('10651824', 11623, 'OPC1931313F51CUE4'), ('11073949', 11623, 'KIO193133ORB6URO0'), ('10944526', 11623, '36X193135JE7E5U6K'), ('10287592', 11623, 'P3S193132IBW318VL'), ('10761882', 11623, 'TQL120100MFB3OBO3'), ('10518756', 11623, 'PCA193135I1L0VVU8'), ('11096191', 11623, 'A64193135PEK3G8LU'), ('10571085', 11623, 'M7J193135YHLNF1ZY'), ('10232072', 11623, 'WR2193133CAIVESF1'), ('10677637', 11623, 'ZOU193133O68GUR2O'), ('10357248', 11623, 'GPX193133SK7BRT5C'), ('10653817', 11623, '4DD120102GT16GKDX'), ('10290161', 11623, '33C193135DG15UGQB'), ('10129560', 11623, '8VB120104JR9OXVA7'), ('10949604', 11623, 'Z8C19313609SKY86X'), ('10672850', 11623, 'ULQ1931325TAFX6Z0'), ('10091433', 11623, 'E8V190337IOJ947K4'), ('10152923', 11623, 'LP7193131T4TKLFRZ')}
        # check_sql = """
        # SELECT sku,source_id,source_sku
        # FROM test_zhcxkj_center_strategy.t_walmart_execute_queue WHERE strategy_type=1;
        # """
        # actual_list = set(self.db.fetch_all_tuple(check_sql,()))
        # print(res_list-actual_list)

    def filter_t_walmart_listing(self, data):
        sql = """
        SELECT id,template_id
        FROM test_zhcxkj_center_listing_comprehensive.t_walmart_listing 
        WHERE  `source_sku` = %s
        AND source_id=%s
        AND `status` = 1
        and is_deleted=0
        """
        res = self.db.fetch_all_tuple(sql, (data[3], data[2]))
        if len(res):
            template_id = res[0][1]
            if template_id:
                ERROR.logger.error(f"source_id={data[2]} source_sku= {data[3]} template_id存在 被去除 ")
                return False
            else:
                return True
        else:
            ERROR.logger.error(f"source_id={data[2]} source_sku= {data[3]} 在listing表查询不到在线数据  被去除 ")
            return False
        # return not len(res)

    def fllter_t_walmart_execute_queue(self, data):
        sql = """
        SELECT id
        FROM test_zhcxkj_center_strategy.t_walmart_execute_queue 
        WHERE strategy_type=1
        AND source_id=%s
        AND source_sku=%s
        AND business_status in (0,1,2)
        AND is_deleted=0
        """
        res = self.db.fetch_all_tuple(sql, (data[2], data[3]))
        if len(res):
            ERROR.logger.error(f"source_id={data[2]} source_sku= {data[3]} 查询到存在strategy_type=1且business_status in (0,1,2)的数据 被去除 ")
            return False
        else:
            return True

        # return not len(res)



if __name__ == '__main__':
    # data = ((24787, '10091433', 11623, 'E8V190337IOJ947K4', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24788, '10110241', 11623, '274190304ZX1IK3KM', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24789, '10194059', 11623, 'RN6190342L5H4IMBV', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24790, '10264383', 11623, 'AFL190422HERZXAM7', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24791, '10341317', 11623, '5ZD1903063GI99OVX', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24792, '10449399', 11623, 'GT51904189K53TQWA', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24794, '10586331', 11623, 'ZZ0190417IH3Z9UA3', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24795, '10655419', 11623, 'KAP190340HBXGM5ZD', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24796, '10686081', 11623, '4EE190257LLC36NU7', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24797, '10886047', 11623, 'PMF190419WKO2W4T3', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24798, '10949706', 11623, 'ZSW190259IHAQD05S', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24799, '11683538', 11623, 'LLE190341BIQF750B', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24800, '11795085', 11623, '5FO190301MKLPR1AU', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24801, '12031220', 11623, 'LHN1903038Z3PAP0P', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24802, '12335982', 11623, '8C0190304EV7T1V0P', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24803, '12363585', 11623, 'X8B190316Z3F9OLCJ', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24804, '12867480', 11623, 'CJP190424J05IK3OA', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24805, '12906900', 11623, 'W051904265ADLKH7R', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24806, '13040573', 11623, 'FDA190427G3HWJC87', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24807, '13496164', 11623, 'D19190434VCZGDYT4', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24808, '13617435', 11623, 'RMX190418UNWV0ZHH', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24809, '1390678', 11623, '0ET190424QCFNT4IK', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24810, '14176055', 11623, 'E2Y190308CJ00C0CX', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24811, '14452874', 11623, 'L8A190422YZWKRFDY', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24812, '14567665', 11623, 'Z2J190338VLZRK8CD', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24813, '3408900', 11623, 'N5P190429YGKT6U7P', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24814, '4447865', 11623, 'DQA190421O82QWFOW', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24815, '4765544', 11623, '1CW190420C9P3CG9G', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24816, '5330335', 11623, 'UAZ1903449TE56CYL', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24817, '5544068', 11623, 'LP1190421XJYLBNPP', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24818, '5563129', 11623, '5HJ190344NKQG3ONU', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24819, '5817610', 11623, '65F1904258SLDCIHT', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24820, '6419795', 11623, '7DZ190424CICWYUCJ', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24821, '6709188', 11623, 'RNL190423MMPGSN0P', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24822, '6799389', 11623, 'MHI190309V6NZVMI7', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24823, '6853338', 11623, 'NBX1903409D1HMNH0', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24824, '6863749', 11623, 'DLY19050843UG1ESK', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24825, '8619212', 11623, 'ZEC190418MG8XAZXT', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24826, '8725207', 11623, 'PQY19034631Z08KUR', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24827, '8813774', 11623, 'JEN1904227H09HWS0', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24828, '8924135', 11623, 'YP7190427GYVZ3D73', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24830, '9258772', 11623, '3K119034293KBR2EI', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24831, '9279857', 11623, 'E3F190310WTM21U7Z', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24832, '9349169', 11623, 'F4F190407MPTFREMH', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24833, '9536829', 11623, 'YCF190421USSRG884', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24834, '9615442', 11623, 'XDN190418H47DCG6C', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24835, '9665397', 11623, '331190316P67LZKYH', datetime.datetime(2023, 10, 26, 4, 0, 4)), (24836, '9726166', 11623, '7LL1904236E9924CG', datetime.datetime(2023, 10, 26, 4, 0, 4)), (89188, '10129560', 11623, '8VB120104JR9OXVA7', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89189, '10653817', 11623, '4DD120102GT16GKDX', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89190, '10761882', 11623, 'TQL120100MFB3OBO3', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89191, '11109015', 11623, 'UB6120105Q3FB2K1Z', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89192, '11540754', 11623, '04L120106J4ZAN27L', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89193, '11839851', 11623, 'VLR120103H5ED1RGJ', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89194, '12329345', 11623, 'Q46120104CEEXJ7US', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89195, '12338978', 11623, '4BA1201045CL6CO59', datetime.datetime(2023, 10, 26, 13, 0, 28)), (89196, '13380677', 11623, 'QCW1201040TYMNMXC', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89197, '13385005', 11623, '5RN120104X0GFIV61', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89198, '14596249', 11623, 'M3B120106G4XKWKP8', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89199, '14659937', 11623, 'H39120104RF86427H', datetime.datetime(2023, 10, 26, 13, 0, 32)), (89200, '15649414', 11623, 'SH612010518QQAAKK', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89201, '15782538', 11623, '05Q120107I0LS9U9X', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89202, '16052213', 11623, 'IDV1201086J7GF6O4', datetime.datetime(2023, 10, 26, 13, 0, 31)), (89203, '16174718', 11623, 'U80120107TUBJIV4B', datetime.datetime(2023, 10, 26, 13, 0, 32)), (89204, '16196074', 11623, 'DSM120107JUCDIWAB', datetime.datetime(2023, 10, 26, 13, 0, 35)), (89205, '16349357', 11623, '9IU120108HTHYWBQS', datetime.datetime(2023, 10, 26, 13, 0, 34)), (89206, '16472347', 11623, '857120108IHY7XX5C', datetime.datetime(2023, 10, 26, 13, 0, 34)), (89207, '1652045', 11623, 'FIE120109H1AG3WL1', datetime.datetime(2023, 10, 26, 13, 0, 35)), (89208, '16568697', 11623, '653120107ZGM1T7D0', datetime.datetime(2023, 10, 26, 13, 0, 34)), (89209, '16588326', 11623, 'L06120106JQIX9DQJ', datetime.datetime(2023, 10, 26, 13, 0, 34)), (89210, '16872950', 11623, 'IC4120108IW32SV5Z', datetime.datetime(2023, 10, 26, 13, 0, 34)), (89211, '2216965', 11623, '476120110HU9WHFN2', datetime.datetime(2023, 10, 26, 13, 0, 35)), (89212, '3095426', 11623, 'AM712010998UZXTOQ', datetime.datetime(2023, 10, 26, 13, 0, 38)), (89214, '3919163', 11623, 'XCO120110LFJ9I4IK', datetime.datetime(2023, 10, 26, 13, 0, 37)), (89215, '4123791', 11623, 'G8412011208GAEEJR', datetime.datetime(2023, 10, 26, 13, 0, 37)), (89216, '4339426', 11623, 'U7O120112U0JPOXAU', datetime.datetime(2023, 10, 26, 13, 0, 37)), (89217, '4514583', 11623, 'F8K120111JN4E43RZ', datetime.datetime(2023, 10, 26, 13, 0, 37)), (89218, '5095347', 11623, 'C6N120110KMO6EMS4', datetime.datetime(2023, 10, 26, 13, 0, 37)), (89219, '5217576', 11623, 'MMK1201134XJKV12I', datetime.datetime(2023, 10, 26, 13, 0, 38)), (89220, '5448687', 11623, 'T8G120111SGBOH4HB', datetime.datetime(2023, 10, 26, 13, 0, 40)), (89221, '6540396', 11623, '4241201124IBO068U', datetime.datetime(2023, 10, 26, 13, 0, 39)), (89222, '6672204', 11623, 'SP5120109WSGAYXQC', datetime.datetime(2023, 10, 26, 13, 0, 39)), (89223, '6827306', 11623, '21C1201121RW4KZW7', datetime.datetime(2023, 10, 26, 13, 0, 40)), (89224, '7249571', 11623, 'B9E120114U3NEWI20', datetime.datetime(2023, 10, 26, 13, 0, 40)), (89225, '7625363', 11623, '4VU120109IVO0E7AV', datetime.datetime(2023, 10, 26, 13, 0, 39)), (89226, '7698999', 11623, '1QF120115PEYXWZXP', datetime.datetime(2023, 10, 26, 13, 0, 40)), (89227, '8753597', 11623, 'XGI120112ADRM6QA0', datetime.datetime(2023, 10, 26, 13, 0, 40)), (89228, '8806868', 11623, 'S9V120114TCK2FDXR', datetime.datetime(2023, 10, 26, 13, 0, 43)), (94636, '10015994', 11623, 'DWX193134RRJQ12JS', datetime.datetime(2023, 11, 1, 15, 31, 58)), (94637, '10152923', 11623, 'LP7193131T4TKLFRZ', datetime.datetime(2023, 11, 1, 15, 31, 58)), (94638, '10232072', 11623, 'WR2193133CAIVESF1', datetime.datetime(2023, 11, 1, 15, 31, 57)), (94639, '10287592', 11623, 'P3S193132IBW318VL', datetime.datetime(2023, 11, 1, 15, 31, 57)), (94640, '10290161', 11623, '33C193135DG15UGQB', datetime.datetime(2023, 11, 1, 15, 31, 57)), (94641, '10357248', 11623, 'GPX193133SK7BRT5C', datetime.datetime(2023, 11, 1, 15, 31, 59)), (94642, '10518756', 11623, 'PCA193135I1L0VVU8', datetime.datetime(2023, 11, 1, 15, 31, 58)), (94643, '10571085', 11623, 'M7J193135YHLNF1ZY', datetime.datetime(2023, 11, 1, 15, 31, 57)), (94644, '10651824', 11623, 'OPC1931313F51CUE4', datetime.datetime(2023, 11, 1, 15, 32, 1)), (94645, '10672850', 11623, 'ULQ1931325TAFX6Z0', datetime.datetime(2023, 11, 1, 15, 32)), (94646, '10677637', 11623, 'ZOU193133O68GUR2O', datetime.datetime(2023, 11, 1, 15, 31, 59)), (94648, '10944526', 11623, '36X193135JE7E5U6K', datetime.datetime(2023, 11, 1, 15, 32)), (94649, '10949604', 11623, 'Z8C19313609SKY86X', datetime.datetime(2023, 11, 1, 15, 31, 58)), (94650, '11073949', 11623, 'KIO193133ORB6URO0', datetime.datetime(2023, 11, 1, 15, 31, 59)), (94651, '11096191', 11623, 'A64193135PEK3G8LU', datetime.datetime(2023, 11, 1, 15, 32, 1)), (94652, '11111865', 11623, 'QGQ1931376N8OX25X', datetime.datetime(2023, 11, 1, 15, 32)), (94653, '11135939', 11623, 'MPI193132SPMA497K', datetime.datetime(2023, 11, 1, 15, 31, 59)), (94654, '11197641', 11623, '2MQ193135UH182M9P', datetime.datetime(2023, 11, 1, 15, 32, 1)), (94655, '11483061', 11623, 'RIF193133WDR1340D', datetime.datetime(2023, 11, 1, 15, 32)), (94656, '11511675', 11623, '99Y1931337K5180HK', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94657, '11528547', 11623, 'T5U193138EERTZM3E', datetime.datetime(2023, 11, 1, 15, 32, 3)), (94658, '11633941', 11623, 'PJD193134DXYUTFSZ', datetime.datetime(2023, 11, 1, 15, 32, 1)), (94659, '11637302', 11623, 'Z8M1931368H456SM4', datetime.datetime(2023, 11, 1, 15, 32, 2)), (94660, '11643560', 11623, 'SN61931348GZDU5T0', datetime.datetime(2023, 11, 1, 15, 32, 2)), (94661, '11729050', 11623, 'LXZ193138PNS96CMZ', datetime.datetime(2023, 11, 1, 15, 32, 3)), (94662, '11798291', 11623, '48H193134XR665XUG', datetime.datetime(2023, 11, 1, 15, 32, 2)), (94663, '11893483', 11623, 'X5R19313428R04VWZ', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94664, '12067258', 11623, 'OV8193135ATL3RKYA', datetime.datetime(2023, 11, 1, 15, 32)), (94665, '12168104', 11623, 'VAT1931353JCDCZS8', datetime.datetime(2023, 11, 1, 15, 32, 2)), (94666, '12309051', 11623, 'TV0193134P0R2AC76', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94668, '12871037', 11623, 'YI71931397RSI7M2G', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94669, '13183124', 11623, 'JJ5193134XEV3RS3P', datetime.datetime(2023, 11, 1, 15, 32, 7)), (94670, '13216213', 11623, 'IAL193137C14LYZ34', datetime.datetime(2023, 11, 1, 15, 32, 5)), (94671, '13235693', 11623, '564193136PW5SG6BC', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94672, '13292746', 11623, 'MU6193135Q07E0HRO', datetime.datetime(2023, 11, 1, 15, 32, 6)), (94673, '13436467', 11623, '80I193136T7OG8UBG', datetime.datetime(2023, 11, 1, 15, 32, 7)), (94674, '13500436', 11623, 'T3V193140EKDSCWYB', datetime.datetime(2023, 11, 1, 15, 32, 7)), (94675, '13528252', 11623, 'V8R193136IX690025', datetime.datetime(2023, 11, 1, 15, 32, 5)), (94676, '13545428', 11623, 'OT0193138Y4WWA3T5', datetime.datetime(2023, 11, 1, 15, 32, 5)), (94677, '13597449', 11623, 'EDN193135DRGFMB0H', datetime.datetime(2023, 11, 1, 15, 32, 3)), (94678, '13621851', 11623, '1AS193135LYFU9EIT', datetime.datetime(2023, 11, 1, 15, 32, 4)), (94679, '13633682', 11623, '6SC1931378SUOLZ6K', datetime.datetime(2023, 11, 1, 15, 32, 7)), (94680, '13633703', 11623, 'KWU193136M1OC99PZ', datetime.datetime(2023, 11, 1, 15, 32, 10)), (94681, '13686354', 11623, 'JET19313510ABLK94', datetime.datetime(2023, 11, 1, 15, 32, 8)), (94682, '13720281', 11623, 'P6Y193138UYJOXGCI', datetime.datetime(2023, 11, 1, 15, 32, 6)), (94683, '13889517', 11623, 'S0S1931393ZNUQ0B9', datetime.datetime(2023, 11, 1, 15, 32, 9)), (94684, '13896343', 11623, 'BX8193138VMGIXU8D', datetime.datetime(2023, 11, 1, 15, 32, 11)), (94685, '13916068', 11623, 'DR7193137P8YE8UCY', datetime.datetime(2023, 11, 1, 15, 32, 7)), (94686, '14096064', 11623, 'OQM193136432TK9OA', datetime.datetime(2023, 11, 1, 15, 32, 6)), (95532, '14320018', 11623, 'C8Y0501136I8AWC9E', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95533, '14334189', 11623, 'ELV050114Q0OEUF8H', datetime.datetime(2023, 11, 1, 15, 33, 37)), (95534, '14555462', 11623, '4WL050111A8BAVKR9', datetime.datetime(2023, 11, 1, 15, 33, 35)), (95535, '14801567', 11623, 'N57050109E6G6XTRQ', datetime.datetime(2023, 11, 1, 15, 33, 37)), (95536, '14801691', 11623, '9RF050111R3B8JF8T', datetime.datetime(2023, 11, 1, 15, 33, 35)), (95537, '14839937', 11623, 'Y85050114QHOUED33', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95538, '15043922', 11623, 'RUD050118F6EI6ODT', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95539, '15372706', 11623, 'NZV050112HPFD0UUX', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95540, '15388932', 11623, 'ZHL050116WS7S78BM', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95541, '15426442', 11623, '6VW050116X23172SB', datetime.datetime(2023, 11, 1, 15, 33, 36)), (95542, '15427784', 11623, 'OKA050115OQUSEKP1', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95543, '15596923', 11623, 'Z0205011311768D5F', datetime.datetime(2023, 11, 1, 15, 33, 35)), (95544, '15703944', 11623, 'T23050113D8U9KX4H', datetime.datetime(2023, 11, 1, 15, 33, 37)), (95545, '15743232', 11623, '00R050114LW8ZWB7G', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95546, '16023579', 11623, '6AU050117Y7JQZG7L', datetime.datetime(2023, 11, 1, 15, 33, 37)), (95547, '16026884', 11623, 'Y9D050117XMBLUTVC', datetime.datetime(2023, 11, 1, 15, 33, 39)), (95548, '16035864', 11623, '6WX0501153RI9IZJZ', datetime.datetime(2023, 11, 1, 15, 33, 38)), (95549, '16075280', 11623, '61Q0501159RSBWE7I', datetime.datetime(2023, 11, 1, 15, 33, 38)), (95550, '16086119', 11623, '5WN050119VWQBS3PV', datetime.datetime(2023, 11, 1, 15, 33, 38)), (95551, '16113949', 11623, 'G5P050118239F1LUR', datetime.datetime(2023, 11, 1, 15, 33, 37)), (95552, '16148838', 11623, 'XGP050120CLMTDKCU', datetime.datetime(2023, 11, 1, 15, 33, 39)), (95553, '16235432', 11623, '80H050113VIYYJ69T', datetime.datetime(2023, 11, 1, 15, 33, 45)), (95554, '16279850', 11623, 'PRW0501182B7VSIAI', datetime.datetime(2023, 11, 1, 15, 33, 38)), (95555, '16286727', 11623, 'XZV050119DACBG50N', datetime.datetime(2023, 11, 1, 15, 33, 40)), (95556, '16309769', 11623, 'FII0501151XDC21DI', datetime.datetime(2023, 11, 1, 15, 33, 39)), (95557, '16366743', 11623, '7XT050119Q4Q6YQAY', datetime.datetime(2023, 11, 1, 15, 33, 44)), (95558, '16410397', 11623, 'ZGD050117IQK25OG9', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95559, '16435039', 11623, 'A0T050114BXL88W0L', datetime.datetime(2023, 11, 1, 15, 33, 39)), (95560, '16447938', 11623, 'NYL050118MI98WSNP', datetime.datetime(2023, 11, 1, 15, 33, 40)), (95561, '16448102', 11623, 'XB805011792FP6WA3', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95562, '16448159', 11623, 'BG4050119B5RS6DV2', datetime.datetime(2023, 11, 1, 15, 33, 42)), (95563, '16456971', 11623, 'CNS050115NJQXNX91', datetime.datetime(2023, 11, 1, 15, 33, 49)), (95564, '16457848', 11623, 'KL8050121QXGUAK77', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95565, '16462468', 11623, '0A8050121S8XLTHYO', datetime.datetime(2023, 11, 1, 15, 33, 43)), (95566, '16466192', 11623, 'W3V050116UMECJV83', datetime.datetime(2023, 11, 1, 15, 33, 41)), (95567, '16481836', 11623, 'AOM050117ZKIIDL66', datetime.datetime(2023, 11, 1, 15, 33, 42)), (95568, '16485250', 11623, 'LM5050124H1X5W4KO', datetime.datetime(2023, 11, 1, 15, 33, 48)), (95569, '16495621', 11623, '2VF0501196JQ0OMOX', datetime.datetime(2023, 11, 1, 15, 33, 43)), (95570, '1844343', 11623, 'JRS050118GXS2OUID', datetime.datetime(2023, 11, 1, 15, 33, 42)), (95571, '1935259', 11623, 'BD5050118579DJSDA', datetime.datetime(2023, 11, 1, 15, 33, 43)))
    # data = (24787, '10091433', 11623, 'E8V190337IOJ947K4', datetime.datetime(2023, 10, 26, 4, 0, 4))
    SkuFilter().sku_filter(11623)
    # SkuFilter().fllter_t_walmart_execute_queue(data)
    # print(SkuFilter().get_platform_sales("16926140", 70, None))
    # orderSourceType_list = [2, 57]
    # sku = "10003056"
    # print(SkuFilter().first_time_filter("10001240"))
